package com.nuhu.service.impl;

import com.nuhu.dao.AdminWorkerDao;
import com.nuhu.pojo.CustomerServiceRecord;
import com.nuhu.pojo.User;
import com.nuhu.pojo.Worker;
import com.nuhu.service.admin_searchUserService;
import com.nuhu.service.admin_workerFucService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

@Component
public class admin_workerFucServiceimpl implements admin_workerFucService {

    @Autowired
    private AdminWorkerDao adminWorkerDao;

    @Override
    public List<Worker> list() {
        return adminWorkerDao.list();
    }

    @Override
    public List<Worker> getWorkers(int page, int size) {
        int offset = (page - 1) * size;
        return adminWorkerDao.getWorkers(offset, size);
    }

    @Override
    public Worker getWorkersPingFen(String WorkerID) {
        System.out.println("该值是"+WorkerID);
        return adminWorkerDao.getWorkerPingFenByID(WorkerID);
    }

    @Override
    public List<CustomerServiceRecord> getWorkersFuWu(String WorkerID) {
        System.out.println("服务该值是"+WorkerID);
        return adminWorkerDao.getWorkerFuWuByWorkerID(WorkerID);
    }

    @Override
    public Worker deleteWorker(String WorkerID) {
        adminWorkerDao.deleteWorkerRecord(WorkerID);
        return adminWorkerDao.deleteWorker(WorkerID);
    }

    @Override
    public void upSalary( BigDecimal Number,String WorkerID) {
        adminWorkerDao.upSalary(Number,WorkerID);
    }

    @Override
    public void downSalary(BigDecimal Number,String WorkerID) {
        adminWorkerDao.downSalary(Number,WorkerID);
    }
}
